﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace PeisongWeb
{
    public partial class indexV2 :buyerPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                rptBind();
            }
        }
        private void rptBind()
        {
            DataTable dt = logic.home.list();
            if (dt != null && dt.Rows.Count > 0)
            {
                DataView v1 = new DataView(dt);
                v1.RowFilter = "Area=1 and isShow=1";
                if (v1.Count > 0)
                {
                    rpt_imgList.DataSource = v1;
                    rpt_imgList.DataBind();
                    rpt_textList.DataSource = v1;
                    rpt_textList.DataBind();
                }

                DataView v2 = new DataView(dt);
                v2.RowFilter = "Area=2 and isShow=1";
                if (v2.Count > 0)
                {
                    rpt_list2.DataSource = v2;
                    rpt_list2.DataBind();
                }
                else
                {
                    dv_sysInfo.Visible = false;
                }
            }
        }
    }
}
